import { AutoFight } from "./AutoFight";
import { AutoFightInfo } from "./AutoFightInfo";
import { GTextFormat } from "../../../common/GTextFormat";
import { SkillSetPanel } from "./SkillSetPanel";
import { GCheckBox } from "../../../../com/mui/controls/GCheckBox";
import { SkillPanel } from "./SkillPanel";
type int = number;
//class UseSkillPanel
    
    export  class UseSkillPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._autoFightInfo = AutoFight.localAutoFight;
            this.init();
            return;
        }

        public set autoFightInfo(arg1: AutoFightInfo)
        {
            this._autoFightInfo = arg1;
            return;
        }

        /* internal  */init(): void
        {
            var loc1=new GTextFormat("", 13, 16777113);
            this._skillSetPanel = new SkillSetPanel();
            this._skillSetPanel.x = 15;
            this._skillSetPanel.y = 10;
            this._skillSetPanel.setIndexComboVisible(false);
            addChild(this._skillSetPanel);
            return;
        }

        /* internal  */onOtherSkillChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            this._autoFightInfo.skillOther = this._otherSkillPanel.skillIdArr;
            this._autoFightInfo.alter = true;
            return;
        }

        /* internal  */onItemUseChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            if (this._itemUse.selected) 
            {
                this._teamFriendCb.enabled = true;
                this._petCb.enabled = true;
            }
            else 
            {
                this._teamFriendCb.enabled = false;
                this._petCb.enabled = false;
                this._teamFriendCb.selected = false;
                this._petCb.selected = false;
            }
            this._autoFightInfo.setAutoFightInfo(this._teamFriendCb.name, this._teamFriendCb.selected);
            this._autoFightInfo.setAutoFightInfo(this._petCb.name, this._petCb.selected);
            this._autoFightInfo.alter = true;
            return;
        }

        /* internal  */onTeamFriendChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            var loc1=arg1.target as GCheckBox;
            this._autoFightInfo.setAutoFightInfo(loc1.name, loc1.selected);
            this._autoFightInfo.alter = true;
            return;
        }

        /* internal  */onPetChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            var loc1=arg1.target as GCheckBox;
            this._autoFightInfo.setAutoFightInfo(loc1.name, loc1.selected);
            this._autoFightInfo.alter = true;
            return;
        }

        /* internal  */resetPanel(arg1: Boolean, arg2: Boolean, arg3: Array<any>): void
        {
            this._skillSetPanel.resetSkillPanel();
            return;
        }

        public update(): void
        {
            this.resetPanel(this._autoFightInfo.fSkill, this._autoFightInfo.pSkill, this._autoFightInfo.skillOther);
            return;
        }

        /* internal */ /* const */otherSkillX: int=110;

        /* internal */ /* const */otherSkillY: int=135;

        /* internal */ /* const */otherSkillNum: int=3;

        /* internal */ /* var */_autoFightInfo: AutoFightInfo;

        /* internal */ /* var */_itemUse: GCheckBox;

        /* internal */ /* var */_teamFriendCb: GCheckBox;

        /* internal */ /* var */_petCb: GCheckBox;

        /* internal */ /* var */_skillSetPanel: SkillSetPanel;

        /* internal */ /* var */_otherSkillPanel: SkillPanel;
    }
